package com.qining618.cms.config;

import com.qining618.common.interceptor.LogFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author flt
 * @date 2019-09-03
 */
@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean filterRegistrationBean(){
        FilterRegistrationBean bean = new FilterRegistrationBean();
        bean.setFilter(new LogFilter());
        bean.addUrlPatterns("/*");
        bean.addInitParameter("excludedUri","*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
        bean.setOrder(Integer.MAX_VALUE);
        return bean;
    }
}
